﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Main.Master" AutoEventWireup="true" CodeBehind="ManageUsers.aspx.cs" Inherits="SignInServices.Admin.ManageUsers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="divSearch">

    </div>
    <div id="divCommands">
        <asp:Button ID="btnAddNewUser" runat="server" Text=" Add new user" 
            style="margin:5px" onclick="btnAddNewUser_Click" 
            PostBackUrl="~/Admin/RegisterNewUser.aspx"/>
    </div>
    <div id="list">

        <asp:GridView ID="gvUsers" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataSourceID="edsUsers" ForeColor="#333333" Width="100%" 
             Font-Names="Tahoma" 
            Font-Size="Small" onrowcommand="gvUsers_RowCommand">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <Columns>
                <asp:BoundField DataField="UserName" HeaderText="User Name" >
                <ItemStyle Width="20%" />
                </asp:BoundField>
                <asp:BoundField DataField="Email" HeaderText="Email Address" >
                <ItemStyle Width="20%" />
                </asp:BoundField>
                <asp:BoundField DataField="CreationDate" DataFormatString="{0:d}" 
                    HeaderText="Creation Date" >
                <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="IsActive">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# (bool)(Container.DataItem as SignInServices.Common.AuthenticatedUser).IsActive ? "Active":"Disabled" %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Commands">
                    <ItemTemplate>
                        <asp:Button ID="btnDelete" runat="server" CommandArgument='<%# Bind("UserName") %>' 
                            CommandName="DoDelete" 
                            onclientclick="if (!confirm('Deleteing a user may damage the client applications. Are you sure?')) return false;" 
                            Text="Delete" />
                        <asp:Button ID="btnEdit" runat="server" CommandArgument='<%# Bind("UserName") %>' 
                            CommandName="DoEdit" Text="Edit" />
                    </ItemTemplate>
                    <ItemStyle Width="10%" />
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>

    </div>
    </asp:Content>
